Skip to content

Conversation

@frama-ci-bot
Copy link
Contributor

No description provided.

@zilbuz
Copy link
Contributor

zilbuz commented Nov 5, 2025

Depend on Frama-C 32.0~beta: #28842

@jmid
Copy link
Member

jmid commented Nov 6, 2025

OK, thanks. Like for the other one, we should wait until #28842 is merged and then rerun CI for this PR.

@jmid jmid closed this Nov 11, 2025
@jmid jmid reopened this Nov 11, 2025
@jmid
Copy link
Member

jmid commented Nov 11, 2025

Retriggered a CI run here too, now that #28842 has been merged.

@jmid jmid removed the do not merge label Nov 11, 2025
@jmid
Copy link
Member

jmid commented Nov 14, 2025

Hm. CI logs is full of conf-libclang failures that I am trying to understand, since it is listing only 6 jobs passed.
This is not a problem with this PR, just a good opportunity to figure out the problem... 🤔

  • It is passing on debian-12 with conf-libclang.15 (installing both libclang-14-dev and libclang-dev system packages...)
  • It is failing on debian-13 with conf-libclang.12 and llvm_version=19.1.7
  • It is failing on debian-testing listing os-version=unknown with conf-libclang.12 and llvm_version=19.1.7
  • It is failing on debian-unstable listing os-version=unknown with conf-libclang.15 and llvm_version=19.1.7

There are several things at play here

  • For the first one, debian with os-version="12" matches several depexts cases in conf-libclang.15
  • The following three fails because llvm 19 is greater than both "at most libclang 12" and "at most libclang 15".
    This should be possible to solve (at least partly) by rolling a new conf-libclang.19
  • I still don't understand why some install conf-libclang.12 and others conf-libclang.15...

@vprevosto
Copy link
Contributor

This is indeed

Hm. CI logs is full of conf-libclang failures that I am trying to understand, since it is listing only 6 jobs passed. This is not a problem with this PR, just a good opportunity to figure out the problem... 🤔

This is indeed a recurring problem, and I think the root cause lies in the fact that conf-llvm and conf-libclang have differing views on how to install their external libraries if they are found to be missing. Now, looking at the synopsis of conf-libclang, it says that it is a "virtual package relying on the installation of llvm and clang libraries" (emphasis mine, as I find it a bit counter-intuitive 😅 given the existence of a conf-llvm package), so maybe making frama-clang depend only on conf-libclang might solve some issues. I'll try it.

@vprevosto
Copy link
Contributor

OK, 54f70db should ensure that opam only install one version of the llvm libraries as a system dependency, but we're left with the issue of convincing conf-libclang to accept it. As you noticed @jmid, this probably involves creating conf-libclang.19. However, noting that for a certain number of distros, the default libclang package will install version 20 if not 21, I'm wondering whether the way conf-libclang traces the versions of libclang is really sustainable. This PR is probably not the most appropriate place to have this kind of discussion, but I'd be happy to take part in it, and I can work on an update if a consensus on a new design emerges.

@jmid
Copy link
Member

jmid commented Nov 23, 2025

I've now opened #28950 which hopefully should address the conf-libclang errors.

@jmid jmid closed this Nov 25, 2025
@jmid jmid reopened this Nov 25, 2025
@jmid
Copy link
Member

jmid commented Nov 25, 2025

I've repeated the close-open dance and pressed 'rebuild all' in opam-ci now that #28950 has been merged.
Fingers crossed that this will address the many conf-libclang.12 errors... 🤞

"zarith" {>= "1.5"}
"camlp5"
"camlp-streams"
"conf-libclang" {>= "11.0.0" & < "20"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"conf-libclang" {>= "11.0.0" & < "20"}
"conf-libclang" {>= "11.0.0"}

I now realize a new all-green conf-libclang.21 is not going to help here! 😅
Could you explain why there is such a conservative upper bound here?
We generally try to avoid them unless there is a good reason for it https://github.com/ocaml/opam-repository/tree/master/governance/policies#5-strict-dependency-constraints-should-be-avoided---or-preventive-upper-bounds
Up until #28950 conf-libclang.15 was the repo's max version... 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are known incompatibilities with clang 21. I have a branch to work on that, but it is not planned to be merged for this release of frama-clang, especially as it involves some changes to the architecture of the plug-in to better abide with clang's guidelines. Generally speaking, there are very often a few changes in libclang's API that break frama-clang between two major versions, hence the upper bound.

By the way, thanks for your efforts on this topic!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for clarrifying! Sounds like we should roll a conf-libclang.19 as we also discussed...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in #28968

@jmid
Copy link
Member

jmid commented Nov 27, 2025

Just did another close-open dance now that #28968 with conf-libclang.19 has been merged... 🤞

@jmid
Copy link
Member

jmid commented Nov 28, 2025

OK, so there's progress. I see compilation failures on Alpine, Debian-12, and newer Ubuntus, all with variations of the following:
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/54f70dbf3bc6d5a86217e550916b1400ce7f19db/variant/distributions,debian-12-ocaml-4.14,frama-clang.0.0.19~beta

#=== ERROR while compiling frama-clang.0.0.19~beta ============================#
# context              2.5.0~rc1 | linux/x86_64 | ocaml-base-compiler.4.14.2 | pinned(https://git.frama-c.com/pub/frama-clang/-/archive/0.0.19-beta/frama-clang-0.0.19-beta.tar.bz2)
# path                 ~/.opam/4.14/.opam-switch/build/frama-clang.0.0.19~beta
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p frama-clang -j 71 --promote-install-files=false @install
# exit-code            1
# env-file             ~/.opam/log/frama-clang-8-d6ad33.env
# output-file          ~/.opam/log/frama-clang-8-d6ad33.out
### output ###
# File "dune", lines 28-41, characters 0-394:
# 28 | (rule
# 29 |  (deps (source_tree framaCIRGen_src) intermediate_format.h intermediate_format.c)
# 30 |  (target framaCIRGen)
# ....
# 39 |   )
# 40 |  )
# 41 | )
# (cd _build/default/framaCIRGen_src && ./build.sh)
# -- The C compiler identification is GNU 12.2.0
# -- The CXX compiler identification is GNU 12.2.0
# -- Detecting C compiler ABI info
# -- Detecting C compiler ABI info - done
# -- Check for working C compiler: /usr/bin/cc - skipped
# -- Detecting C compile features
# -- Detecting C compile features - done
# -- Detecting CXX compiler ABI info
# -- Detecting CXX compiler ABI info - done
# -- Check for working CXX compiler: /usr/bin/c++ - skipped
# -- Detecting CXX compile features
# -- Detecting CXX compile features - done
# -- Performing Test HAVE_FFI_CALL
# -- Performing Test HAVE_FFI_CALL - Success
# -- Found FFI: /usr/lib/x86_64-linux-gnu/libffi.so  
# -- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) 
# -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.13") 
# -- Found zstd: /usr/lib/x86_64-linux-gnu/libzstd.so  
# -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.14") 
# -- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) 
# -- Configuring incomplete, errors occurred!
# See also "/home/opam/.opam/4.14/.opam-switch/build/frama-clang.0.0.19~beta/_build/default/framaCIRGen_src/CMakeFiles/CMakeOutput.log".
# CMake Error at /usr/lib/llvm-14/lib/cmake/clang/ClangTargets.cmake:756 (message):
#   The imported target "clangBasic" references the file
# 
#      "/usr/lib/llvm-14/lib/libclangBasic.a"
# 
#   but this file does not exist.  Possible reasons include:
# 
#   * The file was deleted, renamed, or moved to another location.
# 
#   * An install or uninstall procedure did not complete successfully.
# 
#   * The installation package was faulty and contained
# 
#      "/usr/lib/llvm-14/lib/cmake/clang/ClangTargets.cmake"
# 
#   but not all the files it references.
# 
# Call Stack (most recent call first):
#   /usr/lib/cmake/clang-14/ClangConfig.cmake:19 (include)
#   CMakeLists.txt:31 (find_package)
# 
# 
# make: *** No targets specified and no makefile found.  Stop.

In this case on Debian-12 both libllvm14, libllvm15, and libllvm19 are being installed!
This thus looks to me like we have worked to get clang19 and llvm19 installed,
only for the CMake setup to pickup llvm14 and find its installation lacking...

On Ubuntu 25.04 and 25.10 CMake even detects llvm-20, a seemingly incompatible version IIUC:

#   The imported target "clangBasic" references the file
# 
#      "/usr/lib/llvm-20/lib/libclangBasic.a"

According to https://pkgs.org/search/?q=libLLVMDemangle.a
we should patch conf-libclang.19 to install llvm19-static on Alpine (and probably similar on 21...).

Now: what do we do about the many llvm/clang versions installed on Ubuntu/Debian getting CMake confused?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants